/**
 * MarioPlayerController
 * @extends UTPlayerController
 * @version 2010.11.30
 */

class MarioPlayerController extends UTPlayerController;

var bool slowdown;
var int slowdowntimercount;
var float magnitude;
var Vector direction;

exec function slowdownfunc()
{
	magnitude = vsize(Pawn.Velocity);
	direction = Normal(Pawn.Velocity);
	slowdown=true;
}

function PlayerTick(float DeltaTime)
{
	local float fraction;
	local float z;
	super.PlayerTick(deltaTime);
	z = Pawn.Velocity.Z;

	if(slowdown && !MarioPawn(Pawn).isinair())
	{
		fraction = (20 - slowdowntimercount) / 20;
		Pawn.Velocity = Pawn.Velocity + ((magnitude * fraction) * direction);
		Pawn.Velocity.Z = z;

		slowdowntimercount++;
		if(slowdowntimercount == 20)
		{
			slowdowntimercount = 0;
			slowdown = false;
		}
	}
}

DefaultProperties
{
	slowdown=false
	slowdowntimercount=0
}